<!--
 * @Description: 查看
 * @Author: Liu Zhiwang
 * @Date: 2021-06-08 16:18:15
 * @LastEditTime: 2021-06-08 19:29:46
 * @LastEditors: Liu Zhiwang
-->
<template>
  <div>
    <base-dialog
      class="dialog_box dialog-look"
      width="60%"
      :visible.sync="dialogLook.visible"
      :title="dialog.title"
      :loading="dialog.loading"
      :disabled="dialog.disabled"
      :show-default-footer="false"
      @updateData="updateData"
      @open="beforeOpenDialog">
      <el-form
        ref="dataForm"
        :model="dialog.form"
        :rules="dialog.rules"
        :disabled="dialog.disabled"
        label-width="100px">
        <table id="customers">
          <tr>
            <td>厂家名称</td>
            <td>{{ dialog.form.eqtName }}</td>
            <td>厂家编号</td>
            <td>{{ dialog.form.eqtNo }}</td>
          </tr>
          <tr>
            <td>联系人</td>
            <td>{{ dialog.form.contacts }}</td>
            <td>联系人电话</td>
            <td>{{ dialog.form.contactsPhone }}</td>
          </tr>
          <!-- <tr>
             <td>是否系统</td>
             <td>{{ dialog.form.isSystem?'是':'否' }}</td>
             <td>是否公用</td>
             <td>{{ dialog.form.isPub?'是':'否' }}</td>
           </tr>
           <tr>
             <td>状态</td>
             <td>{{ dialog.form.status?'启用':'禁用' }}</td>
             <td />
             <td />
           </tr>-->
          <tr>
            <td>备注</td>
            <td colspan="3">{{ dialog.form.remark }}</td>
          </tr>
        </table>
      </el-form>
    </base-dialog>
  </div>
</template>
<script>
import { parseTime } from '@/utils'

export default {
  data() {
    return {
      parseTime: parseTime,
      visible: false,
      dataForm: {},
      planTypeList: [
        { label: '1C月度计划', value: '1' },
        { label: '2C月度计划', value: '2' },
        { label: '4C月度计划', value: '4' }
      ],
      cTypeList: [
        { label: '1C', value: '1' },
        { label: '2C', value: '2' },
        { label: '4C', value: '4' }
      ],
      cTypeName: '',
      form: {
        id: null,
        planCode: null,
        status: null,
        deptId: null,
        cType: null,
        preparedBy: null,
        directionId: null,
        planBegin: null,
        planEnd: null,
        planMileage: null,
        planType: null,
        planDepartmentId: null,
        equipment: null,
        planExecutor: null,
        planTrainNum: null,
        enclosure: null,
        remark: null,
        approve: null,
        approvelTime: null,
        conclusion: null,
        opinion: null,
        actualDepartment: null,
        actualDate: null,
        actualBegin: null,
        actualEnd: null,
        actualTester: null,
        actualTraubNum: null,
        actualMileage: null,
        actualRemark: null,
        completeRate: null,
        deptName: null,
        actualDepartmentName: null,
        lineName: null,
        directionName: null,
        planDepartmentName: null
      }
    }
  },
  created() {

  },

  methods: {
    init(data) {
      this.form = data
      this.visible = true
      this.cTypeChange()
      this.$nextTick(() => {

      })
    },
    cTypeChange() {
      var _that = this
      this.cTypeList.forEach(a => {
        if (a.value === _that.form.cType) {
          _that.cTypeName = a.label
        }
      })
    },
    planTypeFormatter(value) {
      var label = ''
      this.planTypeList.forEach(item => {
        if (value === item.value) {
          label = item.label
          return label
        }
      })
      return label
    }

  }
}
</script>
<style lang="scss">
  .dialog-look {
    .el-dialog__body {
      height: calc(80vh - 1px);
      .base-table {
        height: 470px!important;
      }
    }
  }
  #customers {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 20px;
  }
  #customers td, #customers th {
    border: 1px solid #DFE6EC;
    font-size: 16px;
    line-height: 1.5;
    padding: 8px 0;
  }
  #customers tr td:nth-child(odd){
    width: 120px;
    white-space: nowrap;
    padding-left: 20px;
    padding-right: 26px;
    text-align: right;
    background: #E9F2FC;
  }
  #customers tr td:nth-child(even){
    padding-left: 20px;
    padding-right: 20px;
  }
  .dialog_box #customers tr td.file-box {
    width: 100%;
    text-align: left;
    background: #ffffff;
  }
  #customers .file-content {
    min-height: 187px;
  }
</style>
